package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the REASONS_LEAVING database table.
 * 
 */
@Entity
@Table(name="REASONS_LEAVING")
@NamedQuery(name="ReasonsLeaving.findAll", query="SELECT r FROM ReasonsLeaving r")
public class ReasonsLeaving implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="REASONS_LEAVING_REASLID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="REASONS_LEAVING_REASLID_GENERATOR")
	@Column(name="REASL_ID")
	private long reaslId;

	@Column(name="REASL_CREATORDATE")
	private Timestamp reaslCreatordate;

	@Column(name="REASL_NAME")
	private String reaslName;

	@Column(name="REASL_PERSON")
	private String reaslPerson;

	@Column(name="REASL_UPDATEDATE")
	private Timestamp reaslUpdatedate;

	//bi-directional many-to-one association to LaborTurnover
	@OneToMany(mappedBy="reasonsLeaving")
	@JSONField(serialize=false)
	private List<LaborTurnover> laborTurnovers;

	public ReasonsLeaving() {
	}

	public long getReaslId() {
		return this.reaslId;
	}

	public void setReaslId(long reaslId) {
		this.reaslId = reaslId;
	}

	public Timestamp getReaslCreatordate() {
		return this.reaslCreatordate;
	}

	public void setReaslCreatordate(Timestamp reaslCreatordate) {
		this.reaslCreatordate = reaslCreatordate;
	}

	public String getReaslName() {
		return this.reaslName;
	}

	public void setReaslName(String reaslName) {
		this.reaslName = reaslName;
	}

	public String getReaslPerson() {
		return this.reaslPerson;
	}

	public void setReaslPerson(String reaslPerson) {
		this.reaslPerson = reaslPerson;
	}

	public Timestamp getReaslUpdatedate() {
		return this.reaslUpdatedate;
	}

	public void setReaslUpdatedate(Timestamp reaslUpdatedate) {
		this.reaslUpdatedate = reaslUpdatedate;
	}

	public List<LaborTurnover> getLaborTurnovers() {
		return this.laborTurnovers;
	}

	public void setLaborTurnovers(List<LaborTurnover> laborTurnovers) {
		this.laborTurnovers = laborTurnovers;
	}

	public LaborTurnover addLaborTurnover(LaborTurnover laborTurnover) {
		getLaborTurnovers().add(laborTurnover);
		laborTurnover.setReasonsLeaving(this);

		return laborTurnover;
	}

	public LaborTurnover removeLaborTurnover(LaborTurnover laborTurnover) {
		getLaborTurnovers().remove(laborTurnover);
		laborTurnover.setReasonsLeaving(null);

		return laborTurnover;
	}

}